package com.zb.kc.statistics.schedule;

import com.zb.kc.commonutils.DateUtil;
import com.zb.kc.statistics.service.StatisticsDailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.unit.DataUnit;

import java.util.Date;

@Component
public class ScheduleTasks {

    @Autowired
    private StatisticsDailyService statisticsDailyService;

    /**
     * 只能写6位 不能写7位哦
     */
    @Scheduled(cron = "0 0 1 * * ?")
    public void test1() {
        statisticsDailyService.registerCount(DateUtil.formatDate(DateUtil.addDays(new Date(), -1)));
    }
}
